﻿<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %> 
<%@ page import="com.hs.core.utils.*,cn.ac.cintcm.dataconverge.util.*,cn.ac.cintcm.dataconverge.util.Constants,cn.ac.cintcm.dataconverge.researcher.domain.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 
List keyList = (ArrayList)request.getAttribute("keyList"); 
Researcher obj = (Researcher)request.getAttribute("profile"); 
String msg = (String)request.getAttribute("msg")==null?"":(String)request.getAttribute("msg");;
  
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>    
    <title><%=Constants.APP_TITLE %>--个人信息</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    <script src="<%=basePath%>index/Scripts/Script.js" language="javascript" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
    <script language="javascript" src="<%=path %>/js/common.js"></script>
     <script language="javascript" src="<%=path %>/js/check.js"></script>
    <script src='<%=basePath%>dwr/engine.js'></script>
     <script src='<%=basePath%>dwr/util.js'></script> 
     <script src='<%=basePath%>dwr/interface/subject.js'></script> 
      <link href="<%=basePath%>index/Themes/com/style.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" type="text/JavaScript">
      function checkUserAcc(){ 
          var userId = dwr.util.getValue("id");
          if(isNull(userId)){
          		alert("请输入登陆帐号");
          		form1.id.focus();
          		return;
          }
          if(!checkName(userId)){
             alert("登陆的帐号须为数字、字母和下划线的组合!");
             form1.id.focus();
          	 return;
          } 
          subject.checkUserId(userId,callBackForCheckId);
      }
      var flag = true;
      function callBackForCheckId(message){
      	  if("0" != message){
      	    if("1" == message)
      	       alert("此帐号可以使用");
      	    if("2" == message){
      	       alert("此帐号已存在，不可注册");
      	       flag = false;
      	    }
      	  }
      }
      function callBackForCheckId1(message){
      	  if("0" != message){ 
      	    if("2" == message){ 
      	       flag = false;
      	    }
      	  }
      }
      function changeGraduateInfo(){
	      	var graduateInfo = document.getElementById("graduateInfo").value; 
      	if(graduateInfo =="s" || graduateInfo =="0"){
      		document.getElementById("schoolTime").style.display="none";
      	}else{
      	    document.getElementById("schoolTime").style.display="block";
      	}
	      	 
      } 
      function changeOrg(){
         var orgId = dwr.util.getValue("org");
         if(orgId != "0"){
            dwr.util.removeAllOptions("department");
            subject.getDeptList(orgId,callBackForChange);
         }
      
      }
      function callBackForChange(dataStr){
         if(''!= dataStr){ 
          	dwr.util.addOptions("department", eval(dataStr),'id','name');  
         }  
      }
      function submitForm(){
          /**flag = true;
          var userId = dwr.util.getValue("id");
          if(isNull(userId)){
          		alert("请输入登陆帐号");
          		form1.id.focus();
          		return;
          }
          if(!checkName(userId)){
             alert("登陆的帐号须为数字、字母和下划线的组合!");
             form1.id.focus();
          	 return;
          } 
          subject.checkUserId(userId,callBackForCheckId1);  
          setTimeout("checkForm();",1500)
          */
          checkForm();
          
      }
      function checkForm(){
          //if(!flag){
           //  alert("该用户名已注册");
          //   return;
         // }
          var password = dwr.util.getValue("password");
          var passworda = dwr.util.getValue("passworda");
          var org = dwr.util.getValue("org");
          var name = dwr.util.getValue("name"); 
          var idcard = dwr.util.getValue("idcard");
          var position = dwr.util.getValue("position");
          var zhicheng = dwr.util.getValue("zhicheng");
          var qualification = dwr.util.getValue("qualification");
           var group = document.getElementById("group");
           var department = dwr.util.getValue("department");
            var birthday = dwr.util.getValue("birthday"); 
            var zhengjianlx = dwr.util.getValue("zhengjianlx"); 
            
            
          if(isNull(name)){
             alert("请输入姓名");
             form1.name.focus();
             return;
          }
           
           if("1" == zhengjianlx){
	          if(!CheckValue(idcard)){ 
	          		form1.idcard.focus();
	          		return; 
	          } 
          }
           if(isNull(birthday)){ 
                 alert("请输入出生日期");
          		form1.birthday.focus();
          		return; 
          } 
         /** if("0" == position){
             alert("请选择学科角色");
             form1.position.focus();
             return;
          }*/
          if("0" == zhicheng){
             alert("请选择职称");
             form1.zhicheng.focus();
             return;
          }
          if("0" == qualification){
             alert("请选择学位");
             form1.qualification.focus();
             return;
          }  
           form1.submit(); 
      }
    
      // alert("id须为数字、字母和下划线的组合!"); 
    </script>
  </head>
 
<body  class="idt_body" scroll="yes"> 
  <form method="post" name="form1" action="researcher.htm?action=profileSave">
  <table cellpadding="0" cellspacing="0" width="100%" height="100%" id="Table8">
  
        <tr>
            <td  valign="top" height="100%"> 
                            <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" id="Table11">
                                <tr  id="ldTR">
                                    <td  valign="top">
                                        <!------------------ 标题栏 ------------------>
                                        <!--- 标题 ---->
                                        <table class="idt_tle_mg" cellspacing="0" cellpadding="0" width="100%">
                                            <tr  >
                                                <td class="idt_tle_i">
                                                    <img id="imgForm6" src="<%=basePath%>index/Themes/com/idt_tle_o.gif"></td>
                                                <td class="idt_tle_f1">
                                                  个人信息</td>
                                            </tr>
                                        </table>
      <div id="tdForm1">
             <table class="idt_fim_mg" cellspacing="1" cellpadding="0" width="100%" id="">
                 <tr id="tab1">
                     <td>
	   					<fieldset align="center">
			                <legend class="com_legend">登录信息 </legend>
			                <div id="Tr1" align="center"  class="content">&nbsp;</div>
							<table  border="0" cellpadding="0" cellspacing="1" width="100%" class="com_fieldset_tab">
							   <tr>
							      <td class="fim_l" width="15%">登录帐号</td>
							      <td class="fim_r" colspan="3">
							      <input class="com_textbox" type="text" name="id" style="width:95%" value="<%=obj==null?"":obj.getIda()%>" readonly/>
							      <input   type="hidden" name="ids"   value="<%=obj==null?"":obj.getIds()%>"/>
							      <font color="red">*</font>
							      &nbsp;<!-- <input type="button" class="com_textbox"   value="检测帐号是否可用" onclick="checkUserAcc();"/--></td>
							      
							    </tr>
							</table>
     					</fieldset>
				   </td>
				  </tr> 
				    <tr id="tab1">
                     <td>
	   					<fieldset align="center">
			                <legend class="com_legend">基本信息 </legend>
			                <div id="Tr1" class="content">
			                    &nbsp;</div>
							<table  border="0" cellpadding="0" cellspacing="1" width="100%" class="com_fieldset_tab">  
							  <tr>
							      <td class="fim_l" width="15%">姓名</td>
							      <td class="fim_r" colspan="3">
							        <input class="com_textbox" type="text" name="name" style="width:95%" value="<%=obj == null?"":obj.getName()%>"  /><font color="red">*</font></td>
							       
							      
								  </tr>
								  <tr>
								  <td class="fim_l" width="15%">证件类型</td>
							      <td class="fim_r" width="35%">
							      <%out.print(DictHelper.getInst().selectStr(request.getSession().getServletContext(),"zhengjianlx","width:97%", obj==null?"":obj.getZhengjianlx()+"" ,"12"));%></td>
								   <td class="fim_l" width="15%">证件号码</td>
								   <td class="fim_r" width="35%" nowrap>
									    <input class="com_textbox" style="width:95%" type="text" name="idcard" value="<%=obj==null?"":obj.getIdcard()%>"  readonly/>
									    
									  </td> 
								  </tr>
								  <tr>
								   <td class="fim_l">出生日期</td> 
							       <td class="fim_r" nowrap>
								  	<input name="birthday" class="com_textbox" type="text" value="<%=Tools.getDateStringByDate1(obj==null?null:obj.getBirthday())%>" maxlength="10" style="width:95%"  onFocus="WdatePicker({el:'birthday',dateFmt:'yyyy-MM-dd'})"/>
								      <font color="red">*</font>
								   </td>
									   <td class="fim_l">性别</td>
								      <td class="fim_r">
									  	<input type="radio" value="2" name="sex" <%if(obj!=null&&(obj.getSex()+"").equals("2")){out.print(" checked");} %>/>男&nbsp;<input type="radio" value="1" name="sex" <%if(obj!=null&&(obj.getSex()+"").equals("1")){out.print(" checked");} %>/>女
									  </td>
								  </tr>
								   
							    <tr>  
							      <td class="fim_l" width="15%">专业</td>
							      <td class="fim_r" colspan="3">
							       <%out.print(DictHelper.getInst().selectStr(request.getSession().getServletContext(),"major","width:98%", StringUtilTool.NULL2Blank(obj==null?"":obj.getMajor()),"13"));%>
							      </td>      
							    </tr>
							     
							     
							      <tr>
								  <td class="fim_l" width="15%">职称</td>
								  
							      <td class="fim_r" >
							      <%out.print(DictHelper.getInst().selectStr(request.getSession().getServletContext(),"zhicheng","width:95%", obj==null?"":obj.getZhicheng(),"9"));%>
							          <font color="red">*</font>
								  </td> 
								  <td class="fim_l">最高学位</td>
							      <td class="fim_r">
							      <%out.print(DictHelper.getInst().selectStr(request.getSession().getServletContext(),"qualification","width:95%", obj==null?"":obj.getQualification()+"","11"));%>
							        <font color="red">*</font>
								 	  </td>
							    </tr>
							    <tr>
							     <td class="fim_l" width="15%">年龄</td>
							      <td class="fim_r"  >
							        
							      
							        <input class="com_textbox" type="text" name="nianling" style="width:98%" value="<%=StringUtilTool.NULL2Blank(obj == null?"":obj.getNianling())%>"  /></td>
							        
							        <td class="fim_l" width="15%">职务</td>
							      <td class="fim_r"  >
							        <input class="com_textbox" type="text" name="zhiwu" style="width:98%" value="<%=StringUtilTool.NULL2Blank(obj == null?"":obj.getZhiwu())%>"  /> 
							        </td>
							      							       
								  </tr>
								  <td class="fim_l" width="15%">业务专业</td>
							      <td class="fim_r"  >
							        
							      
							        <input class="com_textbox" type="text" name="yewuzy" style="width:98%" value="<%=StringUtilTool.NULL2Blank(obj == null?"":obj.getYewuzy())%>"/></td>
							        
							        <td class="fim_l" width="15%">工作时间</td>
							      <td class="fim_r"  >
							        <input class="com_textbox" type="text" name="gzsj" style="width:98%" value="<%=StringUtilTool.NULL2Blank(obj == null?"":obj.getGzsj())%>"  /></td>
							      							      
								  </tr>
							      
							</table>
     					</fieldset>
				   </td>
				  </tr>
				  
				  
				    <tr id="tab1">
                     <td>
	   					<fieldset align="center">
			                <legend class="com_legend">联系方式 </legend>
			                <div id="Tr1" class="content">
			                    &nbsp;</div>
							<table  border="0" cellpadding="0" cellspacing="1" width="100%" class="com_fieldset_tab">
							  <tr>
							      <td class="fim_l" width="15%">通信地址 </td>
							      <td class="fim_r" width="35%"><input class="com_textbox" name="address" style="width:95%" value="<%=StringUtilTool.NULL2Blank(obj==null?"":obj.getAddress()) %>"/></td>
							      <td class="fim_l" width="15%">邮编</td>
							      <td class="fim_r"><input class="com_textbox" name="postNo" style="width:95%" value="<%=StringUtilTool.NULL2Blank(obj==null?"":obj.getPostNo()) %>"></td>
							    </tr>
							    <tr>
							      <td class="fim_l">固定电话</td>
							      <td class="fim_r"><input class="com_textbox" name="officePhone" style="width:95%" value="<%=StringUtilTool.NULL2Blank(obj==null?"":obj.getOfficePhone()) %>"></td>
								  <td class="fim_l">传真号码</td>
							      <td class="fim_r"><input class="com_textbox" name="fax" style="width:95%" value="<%=StringUtilTool.NULL2Blank(obj==null?"":obj.getFax()) %>"></td>
							    </tr>
							    <tr>
							      <td class="fim_l">移动电话</td>
							      <td class="fim_r"><input class="com_textbox" name="cellphone" style="width:95%" value="<%=StringUtilTool.NULL2Blank(obj==null?"":obj.getCellphone()) %>"/></td>
							       <td class="fim_l">电子邮箱</td>
							      <td class="fim_r"><input class="com_textbox" name="email" style="width:95%" value="<%=StringUtilTool.NULL2Blank(obj==null?"":obj.getEmail()) %>"></td>
							    </tr>
							</table>
     					</fieldset>
				   </td>
				  </tr>
  </table>
  <table cellspacing="0" cellpadding="0" width="100%" class="idt_bottom_mg" border="0">
        <tr>
            <td align="center">
                <input  class="com_btn2" id="Button1" name="save" type="button" onclick="submitForm();" value="保存" >&nbsp;&nbsp;&nbsp;&nbsp;
               <input type="button" value="关闭" name="B4" class="com_btn2" id="Button2" onclick="javascript:window.close();">
            </td>
        </tr>
  </table>             
      </table>
            </td>
        </tr>
    </table></form>
  </body>
</html>
<script type="text/javascript">
<!-- 
<%if(!"".equals(msg)){%> 
   alert('<%=msg%>');  

<%}%>
//-->
</script>
